package tiantao.taogu.TgEnum;


import org.apache.commons.lang.StringUtils;

public enum UserTypeEnum {
    DOCTOR("医生", 1, "user_doctor"),
    PATIENT("患者", 2, "user_patient"),
    ASSISTANT("客服助理", 3, "user_assistant"),
    DEVELOPER("桃谷系统管理员", 4, "user_assistant"),
    HOSPITAL_ADMIN("医院管理员", 5, "user_assistant"),
    HOSPITAL_MANAGER("医院高层管理员", 6, "user_assistant"),
    HIS_ADMIN("桃谷信息管理员", 7, "user_assistant"),
    DOCTOR_D("Doctor_D", 8, "user_assistant"),
    ONLINE_DEPT("在线科室", 9, "user_assistant"),
    CONSULT_ORDER_ADMIN("咨询订单管理员", 10, "user_assistant"),
    PANTAO_ADMIN("91蟠桃管理员", 11, "user_assistant"),
    MEDICINE_SELLER("药店销售", 12, "user_assistant"),
    MEDICINE_MANAGER("药品管理", 13, "user_assistant"),
    MEDICINE_MALL_ADMIN("Admin", 14, "user_assistant"),
    MEDICINE_MALL_MANAGER("药店管理员", 15, "user_assistant"),
    MEDICINE_MALL_ALL_MANAGER("总店管理员", 16, "user_assistant"),
    VIP_CARD_MANAGER("会员卡管理员", 17, "user_assistant"),
    VIPCARD_VERIFICATION_MANAGER("会员卡核销管理员", 18, "user_assistant"),
    VIPCARD_IMPLEMENT_MANAGER("会员卡实施管理员", 19, "user_assistant"),
    PAGE_BUTTON_MANAGER("页面按钮管理", 20, "user_assistant"),
    PRESCRIBE_MANAGER("处方管理员", 21, "user_assistant"),
    PROJECTS_MASTER("项目经理", 22, "user_assistant"),
    SOCIAL_DRUG_SHOPPER("院外药店管理员", 23, "user_drugstore");

    private String name;
    private int id;
    private String tableName;

    private UserTypeEnum(String name, int id, String tableName) {
        this.name = name;
        this.id = id;
        this.tableName = tableName;
 }

    public static UserTypeEnum fromName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        } else {
            name = name.toUpperCase();
            UserTypeEnum[] var4;
            int var3 = (var4 = values()).length;

            for(int var2 = 0; var2 < var3; ++var2) {
                UserTypeEnum o = var4[var2];
                if (o.name().equals(name)) {
                    return o;
                }
            }

            return null;
        }
    }

    public static UserTypeEnum fromId(Integer id) {
        if (id == null) {
            return null;
        } else {
            UserTypeEnum[] var4;
            int var3 = (var4 = values()).length;

            for(int var2 = 0; var2 < var3; ++var2) {
                UserTypeEnum o = var4[var2];
                if (o.getId() == id) {
                    return o;
                }
            }

            return null;
        }
    }

    public static String getName(int id) {
        UserTypeEnum[] var4;
        int var3 = (var4 = values()).length;

        for(int var2 = 0; var2 < var3; ++var2) {
            UserTypeEnum o = var4[var2];
            if (o.getId() == id) {
                return o.name;
            }
        }

        return null;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTableName() {
        return this.tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
}
